from core.basehandler import BaseHandler
from core.room import Room
from core.support import set_cutscene
from core.action import Action
from items.invisibilitycloak import InvisibilityCloak

class ThirdFloor(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room

        self.add_item(InvisibilityCloak())
        
        # build list of actions
        self.add_action(Up)
        self.add_action(Down)
        self.add_action(In)
    
    def get_description(self):
        return 'You are on the 3rd floor'
    
    def get_image(self):
            return 'Room324.jpg'
    
class ThirdFloorHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return ThirdFloor

# define actions for this room

class Up(Action):
    def __init__(self):
        Action.__init__(self, "Up")    # do basic initialization for every action
            
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go Upstairs"
    
    # set cutscene for when arrive in entrance_hall
    def do_action(self,game,room,request):
        set_cutscene("You hear a clanging sound from behind you as you climb the stairs.")
        return
    
            
    # return id of room to enter when action is complete
    def get_destination(self):
        return "fourthFloor"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
class In(Action):
    def __init__(self):
        Action.__init__(self, "In")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go Inside"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'lubinRoom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
class Down(Action):
    def __init__(self):
        Action.__init__(self, "Down")    # do basic initialization for every action
            
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go Downstairs"
    
        
    # return id of room to enter when action is complete
    def get_destination(self):
        return "secondFloor"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

